class Solution(object):
    def dominantIndex(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        max_val = max(nums)
        max_index = nums.index(max_val)
        nums.remove(max_val)
        if not nums:
            return max_index
        next_val = max(nums)
        if next_val == 0:
            return max_index
        else:
            if max_val >= 2 * next_val:
                return max_index
            else:
                return -1